package com.company.project.service;

import com.company.project.model.TopologyHistory;
import com.company.project.vo.req.AttackRecordVo;

import java.util.List;
import java.util.Map;


public interface NetworkService {
    void loadTopology(String topologyFilePath) throws Exception;

    void loadTopology(String topologyFilePath, String fileName, String fileHash) throws Exception;

    void clearNetwork();

    int getAttackerCount();

    int getServerCount();

    void executeAttack(AttackRecordVo attackRecordVo) throws Exception;

    /**
     * 获取服务器流量信息
     * @param serverName 服务器名称
     * @return 流量信息
     * @throws Exception
     */
    String getServerTrafficInfo(String serverName) throws Exception;

    /**
     * 验证攻击是否有效
     * @param attackerName 攻击者名称
     * @param targetName 目标服务器名称
     * @return 攻击验证结果
     * @throws Exception
     */
    String verifyAttack(String attackerName, String targetName) throws Exception;

    List<TopologyHistory> getTopologyHistory();
    Map<String, Object> loadHistoryTopology(String id) throws Exception;

}
